/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.resource.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lczyfz.istep.common.persistence.Page;
import com.lczyfz.istep.common.service.CrudService;
import com.lczyfz.istep.modules.resource.entity.ResourceTrainprogram;
import com.lczyfz.istep.modules.resource.dao.ResourceTrainprogramDao;
import com.lczyfz.istep.common.constants.DeleteFlag;

/**
 * 培训方案Service
 * @author dh
 * @version 2017-01-16
 */
@Service
@Transactional(readOnly = true)
public class ResourceTrainprogramService extends CrudService<ResourceTrainprogramDao, ResourceTrainprogram> {

	@Autowired
	ResourceTrainprogramDao resourceTrainprogramDao ;

	public ResourceTrainprogram get(String id) {
		return super.get(id);
	}
	
	public List<ResourceTrainprogram> findList(ResourceTrainprogram resourceTrainprogram) {
		return super.findList(resourceTrainprogram);
	}
	
	public Page<ResourceTrainprogram> findPage(Page<ResourceTrainprogram> page, ResourceTrainprogram resourceTrainprogram) {
		return super.findPage(page, resourceTrainprogram);
	}
	
	@Transactional(readOnly = false)
	public void save(ResourceTrainprogram resourceTrainprogram) {
		super.save(resourceTrainprogram);
	}
	@Transactional(readOnly = false)
	public void insert(ResourceTrainprogram resourceTrainprogram) {
		dao.insert(resourceTrainprogram);
	}
	@Transactional(readOnly = false)
	public void delete(ResourceTrainprogram resourceTrainprogram) {
		super.delete(resourceTrainprogram);
	}

	//获取所有培训方案名
	public List<ResourceTrainprogram> findAllTrainProgramName(){
		return resourceTrainprogramDao.findAllTrainProgramName(DeleteFlag.deleteFlag);
	}

	public ResourceTrainprogram findTrainprogramByName(ResourceTrainprogram resourceTrainprogram)
	{
		return dao.findTrainprogramByName(resourceTrainprogram);
	}
}